package com.demo.controller;

import com.demo.service.impl.TestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gxd
 * @since 2025/6/9
 */
@Slf4j
@RestController
@RequestMapping("/test")
@Api(tags = "测试管理")
public class TestController {

    @Autowired
    private TestService testService;

    @ApiOperation("获取一个函件唯一序列号")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "province", value = "省会", required = true, dataType = "String", paramType = "path"),
            @ApiImplicitParam(name = "regionCode", value = "行政区划", required = true, dataType = "String", paramType = "path"),
    })
    @GetMapping("/getLetterNumber")
    public String getLetterNumber(@RequestParam("province") String province, @RequestParam("regionCode") String regionCode) {
        return testService.lockLetterNumber(province, regionCode);
    }
}
